--
-- Description: script to create the EventHits table.
-- Date created: 17 Apr 2008
--

set ANSI_NULLS on
set QUOTED_IDENTIFIER on
go

if not exists 
(
    select * 
    from dbo.sysobjects
    where id = object_id(N'[dbo].[EventHits]')
    and objectproperty(id, N'IsUserTable') = 1
)
begin
    create table [dbo].[EventHits]
    (
        [EventID] bigint not null
        , [EventTypeID] smallint not null
        , [DateCreated] smalldatetime not null
        , [DateModified] smalldatetime not null
        , [TotalHits] bigint not null
        , [OperatingSystemID] smallint not null
        , [LocaleID] smallint not null
    ) on [primary]

    print ''
    print '*************************************************************************************'  
    print 'Created table [dbo].[EventHits]'
    print '*************************************************************************************'  
    print ''
end
else
begin
    print ''
    print '*************************************************************************************'  
    print 'Table [dbo].[EventHits] already exists.'
    print '*************************************************************************************'  
    print ''
end
